package vn.student.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;

public class Preferences {
    public static String getValueStr(Context context, String key) {
	SharedPreferences sp= PreferenceManager.getDefaultSharedPreferences(context);
	return sp.getString(key, "0");
    }
    public static void putValueStr(Context context,String key,String value)
    {
	SharedPreferences sp= PreferenceManager.getDefaultSharedPreferences(context);
	Editor editor=sp.edit();
	editor.remove(key);
	editor.putString(key, value);
	editor.commit();
    }
    public static void putValueInt(Context context,String key,int value)
    {
	SharedPreferences sp= PreferenceManager.getDefaultSharedPreferences(context);
	Editor editor=sp.edit();
	editor.remove(key);
	editor.putInt(key, value);
	editor.commit();
    }
}
